<!DOCTYPE html>
<html>
{include file="public/header" /}
<body>


<div class="layui-fluid" id="app">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">


            <div class="layui-card">
                <!--<div class="layui-card-header">云存储</div>-->
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
                        <ul class="layui-tab-title">

                            <li class="layui-this">阿里短信配置</li>

                        </ul>
                        <div class="layui-tab-content">


                            <div class="layui-tab-item layui-show">
                                <div class="layui-form" wid150="" lay-filter="">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">应用key</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="key" value="{$item.key}" lay-verify="required"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">密钥secret</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="secret" lay-verify="required"
                                                   value="{$item.secret}"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">签名</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="sign" lay-verify="required"
                                                   value="{$item.sign}"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">模板</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="template" lay-verify="required"
                                                   value="{$item.template}"
                                                   class="layui-input">
                                        </div>
                                    </div>


                                    <div class="layui-form-item layui-form-text">
                                        <label class="layui-form-label">参考网址</label>
                                        <div class="layui-input-block">
                                            <input type="text" name=""
                                                   value="https://ak-console.aliyun.com/"
                                                   readonly
                                                   class="layui-input">
                                            <input type="text" name=""
                                                   value="https://dysms.console.aliyun.com/dysms.htm#/develop/sign"
                                                   readonly
                                                   class="layui-input">
                                            <input type="text" name=""
                                                   value="https://dysms.console.aliyun.com/dysms.htm#/develop/template"
                                                   readonly
                                                   class="layui-input">


                                        </div>
                                    </div>


                                    <div class="layui-form-item form-footer2">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit="" lay-filter="set_website"><i
                                                    class="layui-icon">&#xe610;</i>保存
                                            </button>
                                        </div>
                                    </div>
                                </div>

                            </div>

                        </div>
                    </div>
                </div>
            </div>


        </div>


    </div>
</div>

<script>


    layui.use(['form'], function () {
        var $ = layui.$
            , layer = layui.layer
            , form = layui.form;

        //网站设置
        form.on('submit(set_website)', function (obj) {
            //layer.msg(JSON.stringify(obj.field));
            $.post("{:url('sms')}", obj.field, function (res) {
                if (res.code == 1) {
                    layer.msg(res.msg, {icon: 1})
                    return false;
                } else {
                    layer.msg(res.msg, {icon: 2}, function () {
//                        location.reload();
                    })
                    return false;
                }

            });
            return false;
        });


    });

</script>
</body>
</html>




